package project.dade.cn.bst.adapter.base;

import android.support.v7.widget.RecyclerView;
import android.widget.RatingBar;

import cn.bingoogolapple.androidcommon.adapter.BGARecyclerViewAdapter;
import cn.bingoogolapple.androidcommon.adapter.BGAViewHolderHelper;
import project.dade.cn.bst.R;
import project.dade.cn.bst.model.ProdectCommentModel;

/**
 * Created by vain zhou on 2016/5/5.
 */
public class ProductAadapter extends BGARecyclerViewAdapter<ProdectCommentModel> {
    public ProductAadapter(RecyclerView recyclerView) {
        super(recyclerView, R.layout.adapter_productcomment);
    }

    @Override
    protected void fillData(BGAViewHolderHelper viewHolderHelper, int postion, ProdectCommentModel model) {
        viewHolderHelper.setText(R.id.comment_user, model.getUserId());
        viewHolderHelper.setText(R.id.comment_time,model.getCommentTime());
        viewHolderHelper.setText(R.id.comment_text,model.getContent());
        RatingBar ratingBar =viewHolderHelper.getView(R.id.comment_rating);
        float rating = Float.valueOf(model.getGrade());
        ratingBar.setRating(rating);
    }
}
